
<form action="../../../excel" method="POST">
   <input type="hidden" name="var" value="hola">
   <input type="submit">
</form>
<?


header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=/var/www/archivo.xls");
header("Pragma: no-cache");
header("Expires: 0");


echo "<table border=1>\n";
echo "<tr>\n";
echo "<th>Referencia</th>\n";
echo "<th>Contacto</th>\n";
echo "<th>Telefoni1</th>\n";
echo "<th>Telefoni2</th>\n";
echo "<th>Mail</th>\n";
echo "<th>BalancePendiente</th>\n";
echo "<th>Producto</th>\n";
echo "</tr>\n";

foreach ($var as $k)
{
  echo "<tr>\n";
	  foreach ($k as $j)
	  {
		 echo "<td>".$j."</td>\n";
	  }
	
	echo "</tr>\n";
	
}

echo "</table>\n";


?>
